<%@ page import="org.apache.ibatis.session.SqlSession" %>
<%@ page import="cn.school.util.MybatisUtil" %>
<%@ page import="cn.school.dao.StudentMapper" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="cn.school.entity.Student" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: oldliu
  Date: 2022-02-15
  Time: 17:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>显示学生信息</title>
</head>
<body>
 <%
     SqlSession s= MybatisUtil.get();
     StudentMapper mapper = s.getMapper(StudentMapper.class);
     //SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");

     List<Student> list2 = mapper.search(1, 20, "", "", "138", null, null);
     //list2.forEach(System.out::println);
     MybatisUtil.close(s);
 %>
<table border="1" cellpadding="0" cellspacing="0">
    <tr>
        <td>学号</td>
        <td>姓名</td>
        <td>手机号</td>
    </tr>
    <%
        for(Student stu:list2){
    %>
    <tr>
        <td><%=stu.getStuno()%></td>
        <td><%=stu.getSname()%></td>
        <td><%=stu.getTelephone()%></td>
    </tr>
    <%}%>
</table>
</body>
</html>
